package com.woniu108.evaluate.client;


import com.woniu108.carService.commos.model.Result;
import com.woniu108.order.model.dto.OrderProductDto;
import com.woniu108.order.model.dto.OrderServiceDto;
import com.woniu108.order.model.form.OrderProductUpdateReviewStateForm;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author LY
 */
@FeignClient(name = "order-server",path = "/order")
public interface OrderClient {
    /**
     * 据编号查询单个商品订单
     * @param orderNum 精确订单编号
     * @return 商品订单
     */
    @GetMapping("/orderProduct/queryOrderProductByOrderNum/{orderNum}.c")
    @ApiOperation(value = "据编号查询单个商品订单")
    Result<OrderProductDto> queryOrderProductByOrderNum(@PathVariable("orderNum") String orderNum);

    /**
     * 按订单编号精确查询服务订单
     * @param orderServiceNum 服务订单编号
     * @return 订单服务信息dto
     */
    @GetMapping("/orderService/queryOrderServiceByOrderServiceNum/{orderServiceNum}.c")
    @ApiOperation("按订单编号精确查询服务订单")
    public Result<OrderServiceDto> queryOrderServiceByOrderServiceNum(@PathVariable("orderServiceNum")String orderServiceNum);

    /**
     * 根据服务订单编号修改评分状态
     * @param orderServiceNum 服务订单编号
     * @return Boolean值
     */
    @GetMapping("/orderService/modifyOrderServiceReviewStateByOrderServiceNum/{orderServiceNum}.c")
    @ApiOperation("根据服务订单编号修改评分状态")
    public Result<Boolean> modifyOrderServiceReviewStateByOrderServiceNum(@PathVariable("orderServiceNum")String orderServiceNum);

    /**
     * 修改订单评价状态和评分
     * @param form
     * @return
     */
    @GetMapping("/orderProduct/updateReviewStateByOrderProductNum.c")
    @ApiOperation("修改订单评价状态和评分")
    public Result<Boolean> updateReviewStateByOrderProductNum(@RequestBody OrderProductUpdateReviewStateForm form);


}
